package com.magnificent.atlantis.server.database.utils;

import com.magnificent.atlantis.common.entity.ServerMeeting;
import com.magnificent.atlantis.common.entity.messages.ServerUpdateMeetingMessage;

import java.util.ArrayList;

/**
 * User: Babanin
 * Date: 06.05.2009
 * Time: 21:30:17
 */
public class ServerMessageHelper {
    public static void merge(ServerMeeting meeting, ServerUpdateMeetingMessage meetingMessage) {
        meeting.setDate(meetingMessage.getDate());
        meeting.setTitle(meetingMessage.getTitle());
        meeting.setDescription(meetingMessage.getComment());
        meeting.setInvitedUsers(meetingMessage.getInvitedUsers());

        ArrayList<Integer> accepted = new ArrayList<Integer>();
        accepted.add(meetingMessage.getUserFromId());
        meeting.setAcceptedByUsers(accepted);
    }
}
